<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<%@include file="/common.jsp" %>
</head>
<body>
	
	<div style="width: 50%;">
		<div style="text-align: right;">登陆用户：${user.username }</div>
		<div style="margin-left: 170px;text-align: center;">
			<c:forEach items="${books }" var="book">
				<div style="float: left;width: 135px;height: 200px;text-align: center;">
					<div>${book.name }</div>
					<div><img src="${ctx }/${book.image }" width="130" height="130"></img></div>
					<div style=""><button onclick="window.location.href='../sec/addCart?bid=${book.id}&bname=${book.name }'">加入购物车</button></div>
				</div>
			</c:forEach>
		</div><p>
		<div><button onclick="window.location.href='../sec/viewcart'">查看购物车</button></div>
		<div><font style="color: blue;">${result }</font></div>
	</div>
</body>
</html>